#include <bits/stdc++.h>
using namespace std;


#ifdef oimasterkafuu
int startClock = clock();
#endif

typedef long long ll;

ifstream fin("duel.in");
ofstream fout("duel.out");

const int MAXN = 100010;
const int inf = 0x3f3f3f3f;

int n;
int a[MAXN];

int attacked[MAXN];
int pre[MAXN];

/**
 * return the minimum j, that
 * j >= i && attacked[j] = 0
 */
int getFirstUnattacked(int i) {
    int left = i;
    int right = n + 1;

    if (attacked[left] == 0) return left;

    while (left + 1 < right) {
        int mid = (left + right) / 2;
        if (attacked[mid] == 1) {
            left = mid;
        } else {
            right = mid;
        }
    }

    return right;
}

int main() {
    fin >> n;
    for (int i = 1; i <= n; ++i)
        fin >> a[i];
    
    sort(a + 1, a + n + 1);
    a[n + 1] = inf;

    // #ifdef oimasterkafuu
    // for (int i = 1; i <= n; ++i) cerr << a[i] << ' ';
    // cerr << endl;
    // #endif
    
    for (int i = n; i >= 1; --i) {
        if (a[i] == a[i + 1]) pre[i] = pre[i + 1];
        else pre[i] = i + 1;
    }

    // #ifdef oimasterkafuu
    // for (int i = 1; i <= n; ++i) cerr << pre[i] << ' ';
    // cerr << endl;
    // #endif

    int cnt = 0;
    for (int i = 1; i <= n; ++i) {
        int nextNum = pre[i];
        if (nextNum == n + 1) {
            ++cnt;
            continue;
        }

        int smallest = getFirstUnattacked(nextNum);
        if (smallest == n + 1) ++cnt;
        else attacked[smallest] = 1;
    }

    fout << cnt << endl;

    #ifdef oimasterkafuu
    int endClock = clock();
    double clocks = (endClock - startClock) * 1000.0 / CLOCKS_PER_SEC;
    cout << fixed << setprecision(6) << clocks << "ms" << endl;
    #endif
}
